<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html class="">
<head>
	
	<meta name="author" content="蓝凌科技">
	<meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">
	<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="0" />

	<link rel="stylesheet" type="text/css" href="/Public/Api/css/sm.min.css">	
	<link rel="stylesheet" type="text/css" href="/Public/Api/css/sm-extend.min.css">	
	
	<title>帮工小哥</title>
	
	<script type="text/javascript">
	    var _root = '<?php echo ($_site_url); echo U(' / ');?>', _controller = '<?php echo ($_controller); ?>';
	</script>
	
	
	<link rel="stylesheet" type="text/css" href="/Public/Api/css/main.css">


</head>
<body>
	
	

<div class="page-group">
    <div class="page page-current">
    		<form action="#" method="post" id="wordCount">
        <div class="bar bar-standard bar-footer choose-people-footer">
            <p><button type="button" onclick="save()" class="button button-fill button-success">提交</button></p>
        </div>
        <div class="content native-scroll">
            <div class="advice-form">
                <textarea name="advice-form" id="content" name="content" cols="30" rows="10" placeholder="帮工小哥致力于给您提供优质的上门服务，欢迎提出宝贵意见或建议~"></textarea>
                <p><span id="text-num">200</span>/<span>200</span></p>
            </div>
        </div>
        </form>
    </div>
</div>




	<!-- 底部
================================================== -->
<footer>
</footer>
<script type="text/javascript">
    (function(){
        var ThinkPHP = window.Think = {
            "ROOT"   : "", //当前网站地址
            "APP"    : "/api.php?s=", //当前项目地址
            "PUBLIC" : "/Public", //项目公共目录地址
            "DEEP"   : "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
            "MODEL"  : ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
            "VAR"    : ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
        }
    })();
    
</script>
<script src="/Public/Api/js/zepto.min.js" type="text/javascript">
</script>
<script type="text/javascript">
//坑死人的配置项
//若不加此配置，则所有页面均使用 js 和 css 缓存
$.config = {
   	router: false
}
</script>
<script src="/Public/Api/js/sm.min.js" type="text/javascript">
</script>
<script src="/Public/Api/js/sm-extend.min.js" type="text/javascript">
</script>
<script src="/Public/Api/js/think.js" type="text/javascript">
</script>


<script type="text/javascript">

$(function(){
    var wordCount = $("#wordCount"), textArea = wordCount.find("textarea"), word = $("#text-num");
    statInputNum(textArea,word);
});

function statInputNum(textArea,numItem) {
    var max = numItem.text(), curLength;
    textArea.attr("maxlength", max);
    curLength = textArea.val().length;
    numItem.text(max - curLength);
    textArea.on('input propertychange', function () {
        numItem.text(max - $(this).val().length);
    });
}

function save(){
	
	var target = Think.U('Feedback/ajax_save');
	var content = $("#content").val();
	
	if(!content){
		$.alert('请填写意见或建议');
		return false;
	}
	
	$.confirm('确认提交？', function () {
		$.post(target, {'content':content}, function(data){
			
			if(data.status == 1){
				
				$.alert('提交成功', function () {
					var loginURL = Think.U('Index/index');
			        window.location.href = loginURL;
			        return false;
				});
			}else if(data.status == -201){
				
				$.confirm('身份认证已失效，请重新登录', function () {
			        var loginURL = Think.U('Public/login');
			        window.location.href = loginURL;
			        return false;
			    });
			}
		});
	});
}

</script>

<!-- 用于加载js代码 -->

</body>
</html>